import 'package:freedom/page/mahjong/common/mahjong_context.dart';
import 'package:freedom/page/mahjong/common/message_content.dart';
import 'package:freedom/page/mahjong/event/user_export_card.dart';
import 'package:freedom/page/mahjong/message/abstract_action_message.dart';

class ExportCard extends AbstractMessageActionHandler<MahjongMessage> {
  @override
  void doMessage(MahjongMessage message) {
    if (message.cardCode == null) {
      return;
    }
    MahjongContext.setExportCardUser(message.exeActionUid, message.cardCode!);
    MahjongContext.postUserEvent<UserExportCardEvent>(message.exeActionUid,
        UserExportCardEvent(message.exeActionUid, message.cardCode!));
  }
}
